package ml;

public class OurThread implements Runnable{
	private BusyFlag bf;
	public OurThread(BusyFlag _bf) { bf = _bf;};
	
	@Override
	public void run() {
		System.out.println("Calling OurThread - " + Thread.currentThread().getId());
		bf.getBusyFlag(100);
		try {
			System.out.println("Before OurThread SLEEP - " + Thread.currentThread().getId());
			Thread.sleep(1000);			
			System.out.println("Before OurThread SLEEP - " + Thread.currentThread().getId());
		} catch (Exception e) {}
		
		bf.freeBusyFlag();
		System.out.println("Leaving OurThread - " + Thread.currentThread().getId());
		
	}

	
}
